package com.start.client.app.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.start.client.app.entity.ClientAppVersionEntity;
import com.start.client.app.vo.ClientClientAppInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ClientAppVersionMapper extends BaseMapper<ClientAppVersionEntity> {
    @Select("SELECT sav.*" +
            " FROM start_app sa" +
            "   INNER JOIN start_app_version sav ON sav.app_manager_id = sa.id" +
            "     AND sa.app_id = #{appInfo.appId} and sav.version_type=#{appInfo.appVersionType}" +
            " ORDER BY sav.app_version_code desc limit 1")
    ClientAppVersionEntity checkAppUpdate(@Param("appInfo") ClientClientAppInfo appInfo);
}
